<?php apf_require_controller('Application_Add');?>
<form action="<?php echo Application_ListController::build_uri();?>" method="post">
<div class="block">
	<span>idx：
		<select name="hostname_id">
			<option value="0">==choose==</option>
			<?php foreach($hostnames as $k=>$v){?>
        	    <option value="<?php echo $v['id'];?>" <?php if($params['hostname_id']==$v['id']){echo "selected";}?>><?php echo $v['hostname'];?></option>
        	<?php }?>
		</select>
	</span>
	<span>port：
		<select name="port">
			<option value="0">==choose==</option>
			<?php foreach($port_list as $k=>$v){?>
        	    <option value="<?php echo $v['port'];?>" <?php if($params['port']==$v['port']){echo "selected";}?>><?php echo $v['port'];?></option>
        	<?php }?>
		</select>
	</span>
	<span>
		<input type="submit" value="search" />
		<input type="hidden" name="action" value="search" />
	</span>
</div>
</form>
<div>
    <table width="100%">
    	<tr class="tr_header">
    		<td>id</td>
    		<td>host</td>
    		<td>solrname</td>
    		<td>webapp</td>
    		<td>port</td>
    		<td>memo</td>
    	</tr>
    	<?php if($app_list){$i=0;foreach($app_list as $alk=>$alv){?>
    	<tr class="<?php if($i%2==0){echo 'tr0';}else{echo 'tr1';}$i++;?>">
    		<td><?php echo $alv['id'];?></td>
    		<td>
    			<span style="color:<?php echo $alv['color'];?>">
        		<?php echo $alv['hostname'];?>
        		</span>
    		</td>
    		<td><?php echo $alv['solrname'];?></td>
    		<td><?php echo $alv['webapp'];?></td>
    		<td><?php echo $alv['port'];?></td>
    		<td><?php echo $alv['memo'];?></td>
    	</tr>
    	<?php }}?>
    </table>
</div>
<form action="<?php echo Application_AddController::build_uri();?>" method="post">
<div class="block">
	<span>idx：
		<select name="hostname_id">
			<?php foreach($hostnames as $k=>$v){?>
        	    <option value="<?php echo $v['id'];?>" <?php if($params['hostname_id']==$v['id']){echo "selected";}?>><?php echo $v['hostname'];?></option>
        	<?php }?>
		</select>
	</span>
	<span>webapp：
		<select name="webapp_id">
			<?php foreach($webapps as $k=>$v){?>
        	    <option value="<?php echo $v['id'];?>" <?php if($params['webapp_id']==$v['id']){echo "selected";}?>><?php echo $v['solrname'].$v['webapp'].':'.$v['port'];?></option>
        	<?php }?>
		</select>
	</span>
	<span>memo：
		<input type="text" name="memo" value="" />
	</span>
	<span>
		<input type="submit" value="add" />
	</span>
</div>
</form>
